package cn.com.surker.vo.main;

import cn.com.surker.material.entity.MainMaterialWeight;
import cn.com.surker.util.StringUtils;
import lombok.Data;
import java.io.Serializable;

@Data
public class MainMaterialWeightVO extends MainMaterialWeight implements Serializable {

    private static final long serialVersionUID = 156456465465465L;

    private String storage;

    /**
     * 车辆自编号
     */
    private String carCode;

    /**
     * 供方与过磅净重差值
     */
    private Double differWeight;

    /**
     * 车次
     */
    private Integer tranNo;

    /**
     * 0 已完成过磅， 1 未完成过磅
     */
    private Integer searchType;
    private Integer materialType;
    private Integer breedType;

    private String searchVal;

    private String startTime;

    private String endTime;

    private String dbCode;
    /**
     * 合同类型
     */
    private Integer contractType;
    /**
     * 车牌号信息
     */
    private String[] carNos;

    /**
     * 运输公司ID
     */
    private Long transportId;

    private Double getDifferWeight() {
        if (!StringUtils.isNull(getSupplierNetWeight()) && !StringUtils.isNull(getNetWeight())) {
            return StringUtils.formatDouble(getSupplierNetWeight() - getNetWeight(), 2);
        }
        return 0.0;
    }
}
